package com.gcc.SpringBootDemo;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @GetMapping("/hello")
    public HelloResponse hello() {
        return new HelloResponse("Hello World!");
    }

//    @GetMapping("/gcc")
//    public String helloGcc() {
//        return "Hello Gcc!";
//    }
//
//    @GetMapping("/hello")
//    public String doubleHello() {
//        return "Hello Hello!";
//    }
    @PostMapping("/hello")
    public HelloResponse helloPost(@RequestBody HelloRequest request) {
        String name = request.getName();
        return new HelloResponse("Hello " + name +"!");
    }

}
